{extend name="public/common"} {block name="body"}
<title>基本设置</title>
<style type="text/css">
.radius1:hover{
 	color: #fff;
	border-color: #66b1ff;
	background-color: #66b1ff;
 }
 span:hover{
 	color: #333;
 }
 .btn-primary {
    color: #fff;
    background-color: #5a98de;
    border-color: #5a98de;
    height: 31px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 24px !important;
}
</style>
</head>
<div style="padding:30px 0;height:30px;">
    <h1 style="line-height:30px;float:left;font-size:18px;margin:10px 10px;padding:0;"> 新增会员等级</h1>
  </div>
  
  <form action="{:url('member/tianjia')}" enctype="multipart/form-data" method="post" class="form form-horizontal" id="form-article-add">
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">会员等级名称</label>
      <div class="formControls col-xs-8 col-sm-9">
      
        <input id="name" type="text" style="width:205px;" name="class_name" required value="" class="input-text"/>
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">返水百分比：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input id="fsbl" type="text" style="width:205px;" name="fsbl" value="" class="input-text"  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">达到等级赠送彩金：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input type="text" style="width:205px;" name="dividend" class="input-text" onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">充值额外赠送百分比：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input id="czzsbl" type="text" style="width:205px;" name="czzsbl" class="input-text"  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">等级提升所需充值量：</label>
      <div class="formControls col-xs-8 col-sm-9">
          <input id="czl" type="text" style="width:205px;" name="czl" class="input-text"  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">等级提升所需洗码量：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input id="xml" type="text" style="width:205px;" name="xml" class="input-text"  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">每月等级赠送彩金：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input type="text" style="width:205px;" name="mearmoney" value="" class="input-text"  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">每月赠送彩金满足投注金额：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input type="number" style="width:100px;" name="zxtzxd" value="0" class="input-text" onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">
         <!--~<input type="number" style="width:105px;" name="zdtzxd" value="10000" class="input-text"  onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')">-->
      </div>
    </div>
    <div class="am-margin" style="margin-top:60px;">
  		<input type="submit" style="margin-left:170px;" class="btn btn-danger radius"  value="提交保存" />
  		<input type="button" onclick="javascript:history.go(-1);" style="margin-left:30px;" class="btn btn-primary radius radius1"  value="关闭" />
  </div>
          
  </form>
  <div>
    
  </div>
{/block} 

{block name="js"}
<script>
  function clearNoNum(obj){
    obj.value = obj.value.replace(/[^\d.]/g,"");  //清除“数字”和“.”以外的字符
    obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的
    obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
    obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');//只能输入两个小数
    if( obj.value.indexOf(".")< 0 && obj.value !="" ){
      obj.value= parseFloat(obj.value);
    }

  }
</script>
<script type="text/javascript">
	$("#form-article-add").submit(function(){
		var fsbl = $("#fsbl").val();
		var czzsbl = $("#czzsbl").val();
		if(fsbl>100){
			layer.msg('返水比例不能大于100');
			return false;
		}
		if(czzsbl>100){
			layer.msg('充值额外赠送百分比不能大于100');
			return false;
		}
	});

</script>

{/block}

